package com.ruoyi.bmxt.utils;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;

/**
 * Created with IntelliJ IDEA.
 *
 * @author 魏建波
 * Date:  2021/7/5
 * Time:  11:12
 * @description
 */
public class LoginUserUtils {
    /**
     * 获得登录id
     * @return
     */
    public static Long getLoginUserId(){
        LoginUser loginUser = SecurityUtils.getLoginUser();
        SysUser sysUser = loginUser.getUser();
        return sysUser.getUserId();
    }

    /**
     * 获得登录用户信息
     * @return
     */
    public static SysUser getLoginUser(){
        LoginUser loginUser = SecurityUtils.getLoginUser();
        SysUser sysUser = loginUser.getUser();
        return sysUser;
    }
}